package view.completeView.groundView;

import java.awt.Color;
import java.awt.Component;
import java.awt.Graphics;

import reference.constants.ConstantProblem;

import utilities.view.PanelBuffer;

import controller.environment.ground.Ground;

public class GroundView extends Component{

	private static final long serialVersionUID = -8949281631475111903L;
	private int m_posXOnScreen;
	private int m_posYOnScreen;
	private Color m_color;
	
	public GroundView(Ground ground){
		m_posXOnScreen = ground.getPosX()*ConstantProblem.BLOCK_SIZE;
		m_posYOnScreen = ground.getPosY()*ConstantProblem.BLOCK_SIZE;
		m_color = ground.getColor();
	}
	
	public void paint(PanelBuffer buffer){
		Graphics graphics = buffer.createGraphics();
		graphics.setColor(m_color);
		graphics.fillRect(m_posXOnScreen, m_posYOnScreen, ConstantProblem.BLOCK_SIZE, ConstantProblem.BLOCK_SIZE);
	}
}
